package cn.iocoder.yudao.module.trade.dal.mysql.depositproductrelation;


import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.trade.api.depositproductrelation.dto.DepositProductRelationDTO;
import cn.iocoder.yudao.module.trade.dal.dataobject.depositproductrelation.DepositProductRelationDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.trade.controller.admin.depositproductrelation.vo.*;

import java.util.List;

/**
 * 钢瓶与押金关系 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface DepositProductRelationMapper extends BaseMapperX<DepositProductRelationDO> {

    default PageResult<DepositProductRelationDO> selectPage(DepositProductRelationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DepositProductRelationDO>()
                .eqIfPresent(DepositProductRelationDO::getDepositId, reqVO.getDepositId())
                .eqIfPresent(DepositProductRelationDO::getSkuId, reqVO.getSkuId())
                .eqIfPresent(DepositProductRelationDO::getSkuCount, reqVO.getSkuCount())
                .betweenIfPresent(DepositProductRelationDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(DepositProductRelationDO::getUpdater, reqVO.getUpdater())
                .orderByDesc(DepositProductRelationDO::getId));
    }

    List<DepositProductRelationDO> selectListByDepostId(Long id);

    List<DepositProductRelationDTO> selectDepositProductByDepositId(Long id);
}